var xhr;
function cartChange() {
    var quantity = document.getElementById("quantity").value;
    xhr = new XMLHttpRequest();
    xhr.onreadystatechange = fun1;
    xhr.open("GET","UpdateUserCart?quantity="+quantity,true);
    xhr.send(null);
}

function fun1() {
    if (xhr.readyState ===4) {
        if (xhr.status ===200) {
            var info = xhr.responseText;
            console.log(info);
            var array = info.split(",");
            var quantity = document.getElementById("quantity");
            var total = document.getElementById("total");
            var subtotal = document.getElementById("subtotal");
            quantity.innerText = array[0];
            total.innerText = array[1];
            subtotal.innerText = array[2];
        }
    }
}
//
// $(function () {
//     $('#quantity').on('blur',function () {
//         $.ajax({
//             type: "GET",
//             url: "cartChange?quantity="+this.value,
//             success: function (data) {
//                 console.log(data);
//                 var str =
//                 var array = str.split(",");
//                 var quantity = document.getElementById("quantity");
//                 var total = document.getElementById("total");
//                 var subtotal = document.getElementById("subtotal");
//                 quantity.innerText = array[0];
//                 total.innerText = array[1];
//                 subtotal.innerText = array[2];
//             }
//         })
//     })
// })

$(function () {
    $('li').on('click',function () {
        $(this).animate({
            opacity: 0.0,
            paddingLeft: '+=80'
        }, 500, function () {
            $(this).remove();
        });
    });
});